//
//  UIAlertController+FGExtension.h
//  FlashFishRec
//
//  Created by LWF on 2018/3/29.
//  Copyright © 2018年 zhangcong. All rights reserved.
//

#import <UIKit/UIKit.h>

#define kFGCancelIndex -1
typedef void(^FGAlertBlock)(NSInteger index);

@interface UIAlertController (FGExtension)

#pragma mark - 通用方法 block中 self不会循环引用
/**    取消按钮在前面     */
+ (instancetype)alertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle btnTitles:(NSArray<NSString *> *)btnTitles style:(UIAlertControllerStyle)style actionBlock:(FGAlertBlock)actionBlock;

/**    取消按钮在后面     */
+ (instancetype)alertWithTitle:(NSString *)title message:(NSString *)message btnTitles:(NSArray<NSString *> *)btnTitles cancelTitle:(NSString *)cancelTitle style:(UIAlertControllerStyle)style actionBlock:(FGAlertBlock)actionBlock;

//add btns
- (void)addbtns:(NSArray<NSString *> *)btnTitles actionBlock:(FGAlertBlock)actionBlock;
//add cancelBtn
- (void)addCancelBtn:(NSString *)cancelTitle actionBlock:(FGAlertBlock)actionBlock;

@end
